<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/25
 * Time: 18:35
 */

namespace app\common\controller;

use app\common\model\AuthRule;
use think\Controller;
use think\Request;
use think\Loader;
use think\auth;

class AdminBase extends Controller
{
    protected function _initialize()
    {
        parent::_initialize();

        $this->getMenu();
    }

    public function index()
    {

    }

    public function getMenu()
    {
        $menu = AuthRule::where(['status' => 1])->select();
        $list = array2tree($menu);
        $menu_list = [];
        foreach($list as $v){
            $menu_list[] = $v;
        }
        dump($menu_list);
        return $this->assign('menu', $menu);
    }
}